package com.twu.biblioteca;

import java.util.List;

public class ReturnBook {

    public static   String getReturn(MainMenu mainMenu, List<IBorrowObject> books,String in,String name) {

        String msg = "That is not a valid "+name+" to return.";
        for (IBorrowObject book : books) {
            if (book.getId().equals(in)&&book.isBorrowed()) {
                book.setBorrowed(false);
                msg = "Thank you for returning the "+name+".";
                return msg;
            }
        }
        return msg;
    }
}
